package org.springframework.zp.mybatis.demo.service;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.zp.mybatis.demo.dao.DemoAMapper;
import org.springframework.zp.mybatis.demo.dao.DemoTMapper;

import java.util.List;
import java.util.Map;

@Slf4j
@Service
public class DemoTServiceImpl implements DemoTService {
	/**
	 * 1、对象？
	 * 2、tMapper如何产生的？谁产生的
	 */
	@Autowired
	DemoTMapper demoTMapper;

	@Autowired
	DemoAMapper demoAMapper;


	@Override
	public List<Map<String, Object>> queryFroList() {
		log.info("[queryFroList] ,A 表  开始  查询 begin");
		List<Map<String, Object>> maps = demoAMapper.queryFroList();
		log.info("[queryFroList] ,A 表  结束   查询 end,map:{}",maps);

		List<Map<String, Object>>  tlist = demoTMapper.queryFroList();
		log.info("[queryFroList],t result,tlist:{}",tlist);
		return tlist;
	}


	@Override
	public Map<String, Object> queryFroMap(Integer id) {
		return demoTMapper.queryFroMap(id);
	}
}
